package common;

import java.io.Serializable;
import java.net.URI;

public class Clock implements Serializable {

	private static final long serialVersionUID = 1L;
	public Integer clock;
	public URI node;

	public Clock(URI node, Integer clock) {
		super();
		this.node = node;
		this.clock = clock;
	}

	@Override
	public boolean equals(Object otherObj) {
		if (otherObj instanceof Clock) {

			// Compare only by uri
			Clock otherClock = (Clock) otherObj;
			if (this.node.equals(otherClock.node)) {
				return true;
			} else {
				return false;
			}
		} else {
			return otherObj.equals(this);
		}
	}
}
